<template>
  <div>
    <h5>搜索结果页 搜索关键字是{{ $route.query.value }}</h5>
    <van-card
      v-for="item in reslist"
      :key="item.id"
      :title="item.title"
      thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      list:[],
      reslist:[]
    }
  },
  mounted() {
    this.$axios.get('/data.json').then((res) =>{
      this.list = res.data.data;
      this.list.forEach((item)=>{
        if(item.title.includes(this.$route.query.value)){
          this.reslist.push(item)
        }
      })
    })
  },
}
</script>